import Content from '@/layout/Content'
import Page404 from '@/pages/page404'
import Pay from '@/pages/pay'
import Paytype from '@/pages/pay/payType'
import Picture from '@/pages/picture'
import Carsoue from '@/pages/picture/Carsoue'
import Product from '@/pages/ProductManagerment'
import Category from '@/pages/ProductManagerment/ProductCategory'
import List from '@/pages/ProductManagerment/ProductList'
import TransactionManagerment from '@/pages/TransactionManagerment'
import Amount from '@/pages/TransactionManagerment/Amount'
import Order from '@/pages/TransactionManagerment/Order'
import Refund from '@/pages/TransactionManagerment/Refund'
import { ReactNode } from 'react'

import Login from '../pages/Login'

let routes: Array<RouteObj> = [
    {
        path: '*',
        element: <Page404 />
    },
    {
        path: '/login',
        element: <Login />
    },
    {
        path: '/',
        element: <Content />,
        children: [
            {
                path: 'product',
                key: 'product',
                label: '商品管理',
                element: <Product />,
                children: [
                    {
                        path: 'category',
                        key: 'category',
                        label: '产品类目',
                        element: <Category />
                    },
                    {
                        path: 'list',
                        key: 'list',
                        label: '产品列表',
                        element: <List />
                    }
                ]
            },
            {
                path: 'picture',
                key: 'picture',
                label: '图片管理',
                element: <Picture />,
                children: [
                    {
                        path: 'Carsoue',
                        key: 'Carsoue',
                        label: '轮播图管理',
                        element: <Carsoue />
                    }
                ]
            },
            {
                path: 'pay',
                element: <Pay />,
                key: 'pay',
                label: '支付管理',
                children: [
                    {
                        path: 'payType',
                        element: <Paytype />,
                        key: 'payType',
                        label: '支付类型',
                    }
                ]
            },
            {
                path: 'transaction',
                element: <TransactionManagerment />,
                key: 'transaction',
                label: '交易管理',
                children: [
                    {
                        path: 'amount',
                        element: <Amount />,
                        key: 'amount',
                        label: '交易金额',

                    },
                    {
                        path: 'order',
                        element: <Order />,
                        key: 'order',
                        label: '订单管理',
                    },
                    {
                        path: 'refund',
                        element: <Refund />,
                        key: 'refund',
                        label: '退款管理',
                    }
                ]
            }

        ]

    }
]


export default routes

